import 'package:flutter_test/flutter_test.dart';
import 'package:inappupdate_flutter/inappupdate_flutter.dart';
import 'package:inappupdate_flutter/inappupdate_flutter_platform_interface.dart';
import 'package:inappupdate_flutter/inappupdate_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockInappupdateFlutterPlatform
    with MockPlatformInterfaceMixin
    implements InappupdateFlutterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final InappupdateFlutterPlatform initialPlatform = InappupdateFlutterPlatform.instance;

  test('$MethodChannelInappupdateFlutter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelInappupdateFlutter>());
  });

  test('getPlatformVersion', () async {
    InappupdateFlutter inappupdateFlutterPlugin = InappupdateFlutter();
    MockInappupdateFlutterPlatform fakePlatform = MockInappupdateFlutterPlatform();
    InappupdateFlutterPlatform.instance = fakePlatform;

    expect(await inappupdateFlutterPlugin.getPlatformVersion(), '42');
  });
}
